#!/bin/bash

echo "===== C语言核心算法测试脚本 ====="

echo
echo "1. 清理之前的编译文件..."
make clean

echo
echo "2. 编译基本测试程序..."
make test-basic

if [ $? -ne 0 ]; then
    echo "❌ 编译失败！请检查编译错误"
    exit 1
fi

echo
echo "3. 运行基本功能测试..."
./test_basic

echo
echo "4. 编译完整优化程序..."
make openmp

if [ $? -ne 0 ]; then
    echo "❌ 完整程序编译失败！"
    exit 1
fi

echo
echo "5. 运行完整优化程序（使用较小参数进行快速测试）..."
./scheduler_optimizer

echo
echo "===== 测试完成！ ====="
echo "请检查生成的文件："
echo "• test_results.txt - 基本测试结果"
echo "• c_transitive_closure.txt - 传递闭包矩阵"
echo "• c_optimization_results.txt - 优化结果"
echo





